package com.rockcent.mall.lib.repository;

import com.rockcent.mall.lib.domain.Evaluation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by zhangjh 2016/10/10.
 */
@Repository
public interface EvaluationRepository extends JpaRepository<Evaluation, Long>, JpaSpecificationExecutor,EvaluationRepositoryCustom {
    Long countByProductId(Long productId);
    List<Evaluation> findByProductId(Long productId);
    List<Evaluation> findByproductIdAndCustomerIdOrderByDateCreatedDesc(Long productId,Long customerId);


    List<Evaluation> findByProductIdOrderByDateCreatedDesc(Long productId);
}
